#! /usr/bin/perl -w

use strict;
use warnings;
use FindBin '$Bin';
use lib $Bin.'/../lib';

use Cantella::DJabberd::Store;

my($username, $password, $full_name) =  @ARGV;

my $schema = Cantella::DJabberd::Store
  ->connect(
            'dbi:mysql:database=cantella_djabberd;host=10.0.7.4',
            'djabberd_test',
            'test01',
            { quote_char => '`', name_sep => '.' },
           );

my $user = $schema->resultset('User')
  ->create(
           {
            username  => $username,
            password  => $password,
            full_name => $full_name,
           }
          );

print($user->username, " successfully created\n");
